local skynet = require "skynet"

local param1 = ""
local param2 = ""

skynet.init(function ()
    skynet.error("[work1] init work param1",param1,"param2",param2)
end)

local function initParams(p1, p2)
    skynet.error("[work1] initParams p1",p1,"p2",p2)
    param1 = p1
    param2 = p2
end

-- 调用初始化函数，...是不定参数，会从skynet.newservice的第二个参数开始透传过来
initParams(...)

local function doWork()
    while true do
        skynet.error("---------work----------------")
        skynet.sleep(200)
    end
end


skynet.start(function ()
   skynet.error("worker start param1 = ",param1,"param2 = ",param2)
   -- doWork()
end)